package com.fivemin.admin.controller;

import com.fivemin.admin.entity.AdminUser;
import com.fivemin.service.admin.AdminUserService;
import com.fivemin.model.response.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: AdminUserController
 * Description:
 * date: 2023/7/27 11:21
 *
 * @author li
 * @since JDK 1.8
 */
@RestController("/user")
@CrossOrigin
public class AdminUserController {

    @Autowired
    private AdminUserService adminUserService;

    /**
     * 添加用户
     * @param adminUser
     * @return
     */
    @PostMapping
    public ResponseBean addAdminUser(@RequestBody AdminUser adminUser){
        return adminUserService.addAdminUser(adminUser);
    }

    @GetMapping
    public ResponseBean findAdminUserList(@RequestParam int pageSize,@RequestParam int pageNum){
        return adminUserService.findAdminUserList(pageSize,pageNum);
    }
}
